﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using DPL.LogicalScript;
using DPLParser.DPLILCode;
using PatternExplorer.DerivedConcepts;
using PatternExplorer.DerivedContainers;
using ConceptsFramework.ConceptResults;

namespace DPL.PatternExplorer.UnitTests.LogicalScript
{
    [TestFixture]
    public class ScriptLogicalHolderTest
    {
        [Test]
        public void TestContrRelationship1()
        {
            DPLParser.DPLParser _localDPLParser = new DPLParser.DPLParser();
            _localDPLParser.Parse(ModuleScript("CONTR(A)=B"));
            DPLScript aDPLScript = _localDPLParser.ParsedModules[0].DPLScripts[0];
            DPLScriptLogicalHolder aScriptHolder = new DPLScriptLogicalHolder(aDPLScript);

            TypeSummary AType = new TypeSummary();
            MethodSummary BMethod = new MethodSummary();
            AType.PublicMethods.Add(BMethod);
            TypeSummarySingletonContainer.Instance.Add(AType);

            aScriptHolder["A"] = new ResultSet(AType);
            var BSet = aScriptHolder["B"];

            
        }

        private string ModuleScript(params string[] instructions)
        {
            string strScript = "module TestModule {";
            strScript += "Pattern TestPattern ";
            strScript += "{";
            foreach (var anInstruction in instructions)
            {
                strScript += anInstruction +"\n";
            }
            strScript += "}";
            strScript += "}";
            return strScript;
        }
    }
}
